package com.fms.data.file;

import java.text.SimpleDateFormat;
import java.util.Calendar;

import com.fms.model.factory.parts.IFileNameSupplier;
import com.fms.model.properties.AbstractProperties;

public class AutoFileNameSelector implements IFileNameSupplier
{

	private AbstractProperties	props;

	public AutoFileNameSelector(AbstractProperties _props)
	{
		this.props = _props;
	}
	
	@Override
	public String getFile()
	{
		SimpleDateFormat format = new SimpleDateFormat(props.getProperty("flowsheet.file.date"));
		String prefix = props.getProperty("flowsheet.file.prefix");
		return "sheets/" + prefix  + format.format(Calendar.getInstance().getTime()) + ".xls";
	}

}
